package com.lagou.dubboprovider;

import com.lagou.dubboapi.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

/**
 * @author zhangxuyuan
 * @version 1.0
 * @date 2020/12/18
 */
@Service
public class HelloServiceImpl implements HelloService {
    Random random = new Random();
    @Override
    public String sayHelloA(String name) {
        int i = random.nextInt(1000);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "SayHelloA: "+name;
    }

    @Override
    public String sayHelloB(String name) {
        int i = random.nextInt(1000);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "SayHelloB: "+name;
    }

    @Override
    public String sayHelloC(String name) {
        int i = random.nextInt(1000);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "SayHelloC: "+name;
    }
}
